#include "widget.h"
#include "./ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(ui->Button_OK,&QPushButton::clicked,this,&Widget::handleClick);//点击按钮触发信号
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleClick()
{
    //当按钮被点击之后把按钮的文本进行切换
    if(ui->Button_OK->text()==QString("确认"))//如果按钮上面的文字是确认
    {
        ui->Button_OK->setText("点击");
        ui->Button_OK->setGeometry(0,0,100,30);
    }else
    {
        ui->Button_OK->setText("确认");
        ui->Button_OK->setGeometry(100,100,90,30);
    }
}
